//
//  回调传值.m
//  AFN 框架
//
//  Created by 钟纪旺 on 2018/2/6.
//  Copyright © 2018年 钟纪旺. All rights reserved.
//

#import "回调传值.h"

@interface 回调传值 (){
    UITextField *textF;
    NSString *textFString;
}

@end

@implementation 回调传值

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    textF = [[UITextField alloc]init];
    textF.frame = CGRectMake(0, 100, self.view.frame.size.width, 30);
    textF.borderStyle = UITextBorderStyleRoundedRect;
    textF.placeholder = @"请输入";
    [self.view addSubview:textF];
    
    UIButton * Backbtn = [UIButton buttonWithType:(UIButtonTypeSystem)];
    
    Backbtn.frame  =CGRectMake(0, 140, self.view.frame.size.width, 30);
    
    [Backbtn addTarget:self action:@selector(backClick:) forControlEvents:(UIControlEventTouchUpInside)];
    [Backbtn setTitle:@"传给第一个界面的" forState:(UIControlStateNormal)];
    Backbtn.backgroundColor = [UIColor cyanColor];
    
    
    [self.view addSubview:Backbtn];
    
    
    // Do any additional setup after loading the view.
}
//返回第一个界面并将值带入
-(void)backClick:(UIButton*)sender{
    //核心代码
    _pushValueString(textF.text);
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}



@end
